<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 父组件模板-->
    <div id="app">
        <cpn><button>按钮</button></cpn>
        <cpn><span>哈哈哈</span></cpn>
        <cpn><i>呵呵</i></cpn>
        <cpn>
            <span>哈哈哈</span>
            <i>呵呵</i>
        </cpn>
    </div>  
 <template id="cpn">
    <div>
       <h2>111111111111</h2>
       <p>你好啊</p>
       <slot><button>按钮</button></slot>
    </div>
 </template>
    <script src="../js/vue.js"></script>
    <script>
          //父组件 ------ 双向绑定案例
          const app=new Vue({
            el:'#app',
            components:{
                    //组件名称
                    cpn:{
                        template:"#cpn"
                    }
                }
        })
    </script>
</body>
</html>